package com.gu.mobileweb.controller;

import com.gu.mobileweb.model.IndexGuess;
import com.gu.mobileweb.service.IndexGuessService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/home/guess")
public class IndexGuessController {
    @Autowired
    private IndexGuessService indexGuessService;

    @GetMapping("/list")
    public List<IndexGuess> list(){
        return indexGuessService.getAllIndexGuess();
    }

    @GetMapping("/listOne")
    public List<IndexGuess> listOne(String guessName) {
        System.out.println("name---->"+guessName);
        return indexGuessService.getListOne(guessName);
    }
}
